"""任一个英文的纯文本文件，统计其中的单词出现的个数。"""

import re


def count_words(filename):
    with open(filename) as f:
        content = f.read()

    words = re.findall(r'[a-zA-Z]+', content)
    return len(words)


if __name__ == '__main__':
    print(count_words('test.txt'))
